A Complete Battery Capacity Measurement Device, Using Arduino-Nano [Lithium-NiMH-NiCd]
Features:
Identify a fake Lithium-Ion/Lithium-Polymer/NiCd/NiMH battery
Adjustable constant current load (can also be modified by the user)
Capable of measuring the capacity of almost any kind of battery (below 5V)
Easy to solder, build, and use, even for beginners (all components are Dip)
An LCD user interface
Specifications:
Board Supply: 7V to 9V(Max)
Battery Input: 0-5V(max) – no reverse polarity
Constant Current Load: 37mA to 540mA(max) – 16 Steps – can be modified by the user
The true measurement of a battery’s capacity is essential for many scenarios. A capacity measurement device can solve the problem of spotting fake batteries as well. Nowadays fake Lithium and NiMH batteries are everywhere which don’t handle their advertised capacities. Sometimes it is difficult to distinguish between a real and a fake battery. This problem exists in the spare batteries market, such as cell phone batteries. Furthermore, in many scenarios, it is essential to determine the capacity of a second-hand battery (for instance a laptop battery). In this article, we will learn to build a battery capacity measurement circuit using the famous Arduino-Nano board. I’ve designed the PCB board for dip components. So even beginners can solder and use the device.
Schematic
PCB
Bill of Materials
Arduino Code
#include <LiquidCrystal.h>
#include <JC_Button.h>
const float Low_BAT_level = 3.2;
//Current steps with a 3R load (R7)
const int Current[] = {0, 37, 70, 103, 136, 169, 202, 235, 268, 301, 334, 367, 400, 440, 470, 500, 540};
const byte RS = 2, EN = 3, D4 = 4, D5 = 5, D6 = 6, D7 = 7;
const byte PWM_Pin = 10;
const byte Speaker = 12;
const int BAT_Pin = A0;
int PWM_Value = 0;
unsigned long Capacity = 0;
int ADC_Value = 0;
float BAT_Voltage = 0;
byte Hour = 0, Minute = 0, Second = 0;
bool calc = false, Done = false;
LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
Button UP_Button(16, 25, false, true);
Button Down_Button(15, 25, false, true);
void setup() {
pinMode(PWM_Pin, OUTPUT);
pinMode(Speaker, OUTPUT);
analogWrite(PWM_Pin, PWM_Value);
UP_Button.begin();
Down_Button.begin();
lcd.setCursor(0, 0);
lcd.begin(16, 2);
lcd.print("Battery Capacity");
lcd.setCursor(0, 1);
lcd.print("Measurement v1.0");
delay(3000);
lcd.clear();
lcd.print("Load Adj:UP/Down");
lcd.setCursor(0, 1);
lcd.print("0");
}
void loop() {
UP_Button.read();
Down_Button.read();
if (UP_Button.wasReleased() && PWM_Value < 80 && calc == false)
{
PWM_Value = PWM_Value + 5;
analogWrite(PWM_Pin, PWM_Value);
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(String(Current[PWM_Value / 5]) + "mA");
}
if (Down_Button.wasReleased() && PWM_Value > 1 && calc == false)
{
PWM_Value = PWM_Value - 5;
analogWrite(PWM_Pin, PWM_Value);
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(String(Current[PWM_Value / 5]) + "mA");
}
if (UP_Button.pressedFor(1000) && calc == false)
{
digitalWrite(Speaker, HIGH);
delay(100);
digitalWrite(Speaker, LOW);
lcd.clear();
timerInterrupt();
}
}
void timerInterrupt() {
calc = true;
while (Done == false) {
Second ++;
if (Second == 60) {
Second = 0;
Minute ++;
lcd.clear();
}
if (Minute == 60) {
Minute = 0;
Hour ++;
}
lcd.setCursor(0, 0);
lcd.print(String(Hour) + ":" + String(Minute) + ":" + String(Second));
lcd.setCursor(9, 0);
ADC_Value = analogRead(BAT_Pin);
BAT_Voltage = ADC_Value * (5.0 / 1024);
lcd.print("V:" + String(BAT_Voltage));
lcd.setCursor(0, 1);
lcd.print("BAT-C: Wait!...");
if (BAT_Voltage < Low_BAT_level)
{
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
Capacity = (Hour * 3600) + (Minute * 60) + Second;
Capacity = (Capacity * Current[PWM_Value / 5]) / 3600;
lcd.print("BAT-C:" + String(Capacity) + "mAh");
Done = true;
PWM_Value = 0;
analogWrite(PWM_Pin, PWM_Value);
digitalWrite(Speaker, HIGH);
delay(100);
digitalWrite(Speaker, LOW);
delay(100);
digitalWrite(Speaker, HIGH);
delay(100);
digitalWrite(Speaker, LOW);
}
delay(1000);
}
}
A Complete Battery Capacity Measurement Device, Using Arduino-Nano [Lithium-NiMH-NiCd]
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(2)
- Likes(7)
- Commodore Bench Jul 21,2022
- Engineer Aug 09,2021
- Arpad Attila Bakos Apr 25,2021
- DarkoPatic May 14,2020
- Engineer May 04,2020
- Marco Guerrato Apr 22,2020
- William Ronald Boyd Apr 14,2020
- 8 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
6design
-
9usability
-
8creativity
-
10content
-
9design
-
9usability
-
10creativity
-
9content
-
7design
-
6usability
-
6creativity
-
6content
-
7design
-
9usability
-
8creativity
-
9content
-
8design
-
9usability
-
7creativity
-
10content
-
8design
-
8usability
-
8creativity
-
9content
-
9design
-
10usability
-
10creativity
-
9content
-
10design
-
10usability
-
10creativity
-
10content
More by Hesam Moshiri
- Wireless Home Automation (Control and Monitoring) Using a Nextion HMI Display Nowadays home automation is a trending topic among electronic enthusiasts and even the mass populati...
- High Precision Digital AC Energy Meter Circuit Voltage-Current-Power-KWh Disclaimer: Some parts of this circuit carry dangerous Mains voltage. Be careful with your experimen...
- 40V-30A Adjustable Switching Power Supply A DC-to-DC converter is one of the most commonly used circuit topologies in electronics, especially ...
- Graphical Temperature & Humidity Control Unit Using a Raspberry Pi Pico [Home Automation] Raspberry Pi Pico is a cute piece of hardware. It is equipped with a powerful dual-core RP2040 micro...
- Infrared Remote Control Decoder & Switcher Board Infrared remote controllers are everywhere around us. The majority of home appliances are controlled...
- 0-30V, 0-7A Adjustable Switching Power Supply The DC to DC buck converter is a famous topology in the electronic and a widely used circuit in elec...
- Adjustable Switching Power Supply Using LM2576 [Buck Converter, CC-CV] Switching power supplies are known for high efficiency. An adjustable voltage/current supply is an i...
- A Complete Battery Capacity Measurement Device, Using Arduino-Nano [Lithium-NiMH-NiCd] Features:Identify a fake Lithium-Ion/Lithium-Polymer/NiCd/NiMH batteryAdjustable constant current lo...
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
79 1 1 -
-
-
-
Sega Master System RGB Encoder Switcher Z80 QSB v1.2
70 0 0 -
18650 2S2P Battery Charger, Protection and 5V Output Board
102 0 0 -
High Precision Thermal Imager + Infrared Thermometer | OpenTemp
514 0 7 -
Sony PlayStation Multi Output Frequency Oscillator (MOFO) v1
145 0 2 -